package xtgl;

import java.util.List;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;


public class Role extends Model<Role> {

	public static final Role dao = new Role();

	public List<Role> getRoles() {
		List<Role> list = Role.dao.find("select * from role");
		return list;
	}
	
	//根据roleId删除角色
	public void deleteRole(Integer roleId){
		Db.update("delete from role where role_id=" + roleId);
	}
	/**
	 * 根据权限id查询
	 */
	public Role getRole(Integer roleId){
		return Role.dao.findById(roleId);
	}
 
}
